<template>
	<view class="layout">
		<view class="navbar">
			<view class="statusBar"  :style="{height: getBarHeight()+'px'}"></view>
			<view class="titlebar" :style="{height:getTitleBarHeight()+'px'}">
				<view class="title">推荐</view>
				<view class="search" @click="search">
					<uni-icons class="icon" type="search" color="#888" size="20"></uni-icons>
					<text class="text">搜索</text>
			    </view>
			</view>
		</view>
	    <view :style="{height: NavBarHeight()+'px'}"></view>
	</view>
</template>

<script  setup>
import { ref } from 'vue'
import {getBarHeight,getTitleBarHeight,NavBarHeight} from  '@/utils/system.js'
	// let SYSTEM_INFO=uni.getSystemInfoSync()
	// console.log(SYSTEM_INFO);
	// let statusBarHeight = ref(SYSTEM_INFO.statusBarHeight)
	// let {top,height}=uni.getMenuButtonBoundingClientRect()
	// let TitleBarHeight=height+(top-statusBarHeight.value)*2
function search(){
	uni.navigateTo({
		url:'/pages/search/search'
	})
}
</script>

<style lang="scss" scoped> 
.layout{
	.navbar{
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 10;
		background: linear-gradient(to bottom,transparent,#fff 600rpx),
		            linear-gradient(to right,#3e9aca 20%,#f4e2d8);
		// .statusBar{
		// 	height: 40px;
		// 	border: 1px solid black;
		// }
		.titlebar{
			display: flex;
			padding: 0 30rpx;
			align-items: center;
			// border: 1px solid green;
			.title{
				font-size: 60rpx;
				font-weight: 700;
				// margin-left: 30rpx;
			}
			.search{
				width: 220rpx;
				height: 60rpx;
				margin-left: 10rpx;
				border: 1rpx solid #888;
				border-radius: 100rpx;
				background-color: rgba(255, 255, 255, 0.5);
				display: flex;
				align-items: center;
				.icon{
					padding: 5rpx;
				}
				.text{
					color: #888;
				}
			}
		}
	}
}
</style>